#include<future>
#include<iostream>
#include<unistd.h>

int Add(int num1,int num2)
{
    std::cout<<"你坏"<<std::endl;
    sleep(5);
    std::cout<<"你好"<<std::endl;
    return num1+num2;
}

int main()
{
    std::cout<<"-------1--------"<<std::endl;
    std::future<int> result=std::async(std::launch::async,Add,11,22);
    sleep(1);
    std::cout<<"-------2--------"<<std::endl;
    int ret=result.get();
    std::cout<<ret<<std::endl;
    std::cout<<"-------3--------"<<std::endl;
    
    return 0;
}